﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.Core.Interceptor;
using System.Reflection;
using JackyCode.Mock.Exceptions;

namespace JackyCode.Mock
{
    public class MockInterceptorImpl:IMockInterceptor
    {
        public IMockData MockData { get; set; }

        public MockInterceptorImpl(IMockData mockData)
        {
            this.MockData = mockData;
        }

        public void Intercept(IInvocation invocation)
        {
            MockData.SetOutParamterVal(invocation.Method, invocation.Arguments);
            invocation.ReturnValue = MockData.GetReturnVal(invocation.Method,invocation.Arguments);
        }
    }
}
